package cn.hxth.cloud.datasync.rabbitmq;

import cn.hxth.cloud.api.domain.ProductionOrder;
import cn.hxth.cloud.api.rabbitmq.AbstractRabbitMQHandler;
import cn.hxth.cloud.api.rabbitmq.RabbitMQSender;
import cn.hxth.cloud.service.service.CheckService;
import cn.hxth.cloud.service.service.OrderService;
import cn.hxth.cloud.service.service.ProductionService;
import cn.hxth.cloud.service.service.WmsService;
import com.alibaba.fastjson.JSONObject;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@RabbitListener(queues = "data-change-queue-check")
public class DataChangeQueueReceiver extends AbstractRabbitMQHandler {
    @Autowired
    public DataChangeQueueReceiver(RabbitMQSender rabbitMQSender) {
        super(rabbitMQSender);
        super.setLogger(DataChangeQueueReceiver.class);
    }


    @Autowired
    private OrderService orderService;
    @Autowired
    private CheckService CheckService;
    @Autowired
    private ProductionService productionService;
    @Autowired
    private WmsService wmsService;
    /*@Resource
    private WmsFacadeService wmsFacadeService ;*/
    public  Boolean processInsertCheckOrder(JSONObject jsonObject,String jsonData){
      return    this.CheckService.insertCheckOrder(JSONObject.parseObject(jsonData,ProductionOrder.class)) ;
    }





}
